package com.hotel.services.impl;

import com.hotel.daos.PositionMapper;
import com.hotel.entitys.Position;
import com.hotel.services.PositionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
@Service
@Transactional
public class PositionServiceImpl implements PositionService {
    @Autowired
    private PositionMapper positionMapper;
    @Override
    public List<Position> getAllPosition() {
        return positionMapper.selectAllPosition();
    }

    @Override
    public int addPosition(Position position) {
        return positionMapper.insertPosition(position);
    }

    @Override
    public Position getPositionById(Integer position_id) {
        return positionMapper.selectPositionById(position_id);
    }

    @Override
    public int changePosition(Position position) {
        return positionMapper.updatePosition(position);
    }

    @Override
    public int deleteOne(Integer position_id) {
        return positionMapper.deletePositionById(position_id);
    }

    @Override
    public int deleteMulti(Object[] ids) {
        return positionMapper.deletePositionByIds(ids);
    }
}
